Skip to content

Forward environment variables through runtime exec - #34

Closed
scuffi wants to merge 1 commit into
mainfrom
computer-runtime-env
Closed

Forward environment variables through runtime exec#34
scuffi wants to merge 1 commit into
mainfrom
computer-runtime-env

Conversation

@scuffi

@scuffi scuffi commented Jul 31, 2026

Copy link
Copy Markdown

No description provided.

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/computer/@cloudflare/computer@34

commit: 1662c19

@scuffi
scuffi force-pushed the computer-runtime-env branch from 68f24da to 7171371 Compare July 31, 2026 14:49
@scuffi
scuffi force-pushed the computer-runtime-env branch from 7171371 to 1662c19 Compare July 31, 2026 16:16

@aron-cf aron-cf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to see if I can refactor out the command vs module distinction. But the feedback for now stands.

```

`input` is accepted by structured module backends and rejected by command backends. `cwd` is the command working directory or the base for durable relative module imports. A handle is single-consumer: call `result()` or consume its event stream, not both. Repeated `result()` calls return the same promise. `backend` records the resolved backend needed for later reattachment.
`input` is accepted by structured module backends and rejected by command backends. `env` is accepted by command backends and rejected by module backends; its values override that command's inherited environment without changing later executions. `cwd` is the command working directory or the base for durable relative module imports. A handle is single-consumer: call `result()` or consume its event stream, not both. Repeated `result()` calls return the same promise. `backend` records the resolved backend needed for later reattachment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should support piping env into module backends too, in a worker any env variable is populated on process.env.

@aron-cf

aron-cf commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Superseded by my PRs that refactors the JavaScript backend to align with how the container shell interface works — the shell/command env path lands in #39 , and the env option surface plus JavaScript-runtime process.env support lands in the process-shim in #34.

The module-backend rejection in this PR was dropped so env reaches the JavaScript runtime via process.env as well as command backends. In general we no longer distinguish between shell/command backends, but instead whether the backend is "callable". In theory we should be able to make any shell backend callable, e.g. by providing a structured output schema.

@aron-cf aron-cf closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants